home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / UNIX.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-30  |  4.2 KB  |  160 lines

  1. #ifndef    _UNIX_H
  2. #define    _UNIX_H
  3. #define _HARDWARE_H
  4.  
  5. /*
  6.  * Making a very PC-hardware-oriented program work under Unix is, to say the
  7.  * least, interesting.
  8.  */
  9.  
  10. #ifndef    _GLOBAL_H
  11. #include "global.h"
  12. #endif
  13.  
  14. #ifndef _CTYPE_H
  15. #include "ctype.h"
  16. #endif
  17.  
  18. #ifndef _TIME_H
  19. #include <time.h>
  20. #endif
  21.  
  22.  
  23. struct screen {
  24.     struct sessmgr_sw *sessmgr;    /* session manager */
  25.     int flags;            /* per-session flags */
  26. #define SMS_ACTIVE    0x01    /*   session can do output */
  27. #define SMS_DISCARD    0x02    /*   if not active, don't block; discard */
  28. #define SMS_NOFLOW    0x04    /*   don't do flow control */
  29. #define SMS_SPLIT    0x08    /*   wants to be split, if possible */
  30.     void *sesmdat;        /* per-session data for session manager */
  31.     char *next_sm;        /* session manager for new sessions */
  32.     char *use_sm;        /* session manager override for "create" */
  33.     unsigned char attr;
  34.     unsigned char statline;
  35. };
  36. #define    NULLSCREEN    (struct screen *)0
  37.  
  38. /* from unix.c */
  39. extern void register_io (int fd, void *event);
  40. extern void unregister_io (int fd);
  41. extern unsigned long filelength (int fd);
  42. #ifdef NEED_STRCASECMP
  43. extern int strcasecmp (char *s1, char *s2);
  44. #endif
  45. #ifdef NEED_STRNCASECMP
  46. extern int strcasecmp (char *s1, char *s2);
  47. #endif
  48. extern void init_sys (int);
  49. extern void deinit_sys (void);
  50. extern void giveup (void);
  51. #ifndef _GLOBAL_H
  52. #ifdef J_FREE_HACK
  53. extern void j_free (void *);
  54. #else
  55. extern void j_free (const void *);
  56. #endif
  57. #endif
  58.  
  59. /* from unixxasy.c */
  60. extern int doasyconfig (int, char **, void *);
  61.  
  62. /* from sessmgr.c */
  63. extern void ioinit (int);
  64. extern void iostop (void);
  65. extern void iosuspend (void);
  66. extern void ioresume (void);
  67. extern void swapscreen (struct session *old, struct session *new);
  68. extern void putch (int c);
  69. extern void cputs (const char *);
  70. extern void clreol (void);
  71. #ifndef _GLOBAL_H
  72. extern void rflush (void);
  73. #endif
  74. extern void j_newscreen (struct session *);
  75. extern void freescreen (struct session *);
  76. extern void clrscr (void);
  77. extern int wherex (void);
  78. extern int wherey (void);
  79. extern void window (int, int, int, int);
  80. extern void gotoxy (int, int);
  81. extern void highvideo (void);
  82. extern void normvideo (void);
  83. extern void _setcursortype (int);
  84. extern int kbread (void);
  85. extern struct sessmgr_sw *sm_lookup (const char *, const char **);
  86. extern struct session *sm_newsession (const char *, const char *, int, int);
  87. extern int sm_blocked (struct session *);
  88. extern int sm_usestdio (void);
  89.  
  90. /* from lxasy.c */
  91. extern void detach_all_asy (void);
  92.  
  93. /*
  94.  * unix functions - can't include system headers or we'll have major collisions
  95.  * because JNOS usurps e.g. all the socket and timer calls
  96.  */
  97. #ifdef __cplusplus
  98. extern "C" {
  99. #endif
  100.  
  101. #ifndef _UNIXTM_H
  102. extern long dostounix (struct date *, struct time *);
  103. #endif
  104. #ifndef _SYS_STAT_H
  105. extern int mkdir (const char *pthname, mode_t mode);
  106. #endif
  107. #if defined(HAVE_UNISTD_H)
  108. #include <unistd.h>
  109. #else
  110. extern int setreuid (uid_t ruid, uid_t euid);
  111. extern int setregid (gid_t rgid, gid_t egid);
  112. extern uid_t getuid (void);
  113. extern gid_t getgid (void);
  114. extern int chown (const char *path, uid_t owner, gid_t group);
  115. extern unsigned int sleep (unsigned int seconds);
  116. extern int isatty (int);
  117. extern int getpid (void);
  118. extern int unlink (const char *);
  119. extern int fork (void);
  120. extern int execvp (const char *, const char **);
  121. extern off_t lseek (int, off_t, int);
  122. extern int read (int, void *, unsigned);
  123. extern int close (int);
  124. extern int access (const char *, int);
  125. extern int write (int, const void *, unsigned);
  126. extern char *getcwd (char *, size_t);
  127. extern int pipe (int *);
  128. extern int execv (const char *, const char **);
  129. extern int execve (const char *, const char **, const char **);
  130. extern int rmdir (const char *);
  131. /* #endif */
  132. #if 0
  133. extern int kill (pid_t, int);
  134. extern char *strdup (const char *);
  135. #endif
  136. extern char *mktemp (char *);
  137. struct timeval;
  138. #ifndef lint
  139. extern int select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
  140. #endif
  141. #endif
  142.  
  143. #ifdef __cplusplus
  144. }
  145. #endif
  146.  
  147. #define newscreen j_newscreen
  148.  
  149. #define _NOCURSOR 0
  150. #define _NORMALCURSOR 1
  151. #define _SOLIDCURSOR 2
  152.  
  153. #ifndef _GLOBAL_H
  154. #define strnicmp strncasecmp
  155. #define stricmp strcasecmp
  156. #endif
  157.  
  158. #define SETVBUF 1
  159. #endif    /* _UNIX_H */
  160.